home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / RootPaneContainer.java < prev    next >
Text File  |  1998-06-30  |  5KB  |  152 lines

  1. /*
  2.  * @(#)RootPaneContainer.java    1.9 98/04/03
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing;
  22.  
  23. import java.awt.Component;
  24. import java.awt.Container;
  25.  
  26.  
  27. /**
  28.  * This interface is implemented by components that have a single
  29.  * JRootPane child: JDialog, JFrame, JWindow, JApplet, JInternalFrame.
  30.  * The methods in  this interface are just <i>covers</i> for the JRootPane 
  31.  * properties, e.g. <code>getContentPane()</code> is generally implemented 
  32.  * like this:<pre>
  33.  *     public Container getContentPane() {
  34.  *         return getRootPane().getContentPane();
  35.  *     }
  36.  * </pre>
  37.  * This interface serves as a <i>marker</i> for Swing GUI builders
  38.  * that need to treat components like JFrame, that contain a
  39.  * single JRootPane, specially.  For example in a GUI builder, 
  40.  * dropping a component on a RootPaneContainer would be interpreted 
  41.  * as <code>frame.getContentPane().add(child)</code>.  
  42.  * 
  43.  * @see JRootPane
  44.  * @see JFrame
  45.  * @see JDialog
  46.  * @see JWindow
  47.  * @see JApplet
  48.  * @see JInternalFrame
  49.  *
  50.  * @version 1.9 04/03/98
  51.  */
  52. public interface RootPaneContainer
  53. {
  54.     /**
  55.      * Return this component's single JRootPane child.  A conventional
  56.      * implementation of this interface will have all of the other 
  57.      * methods indirect through this one.  The rootPane has two
  58.      * children: the glassPane and the layeredPane.
  59.      *
  60.      * @return this components single JRootPane child.  
  61.      * @see JRootPane
  62.      */
  63.     JRootPane getRootPane();
  64.  
  65.  
  66.     /**
  67.      * The "contentPane" is the primary container for application 
  68.      * specific components.  Applications should add children to 
  69.      * the contentPane, set its layout manager, and so on.  
  70.      * <p>
  71.      * The contentPane my not be null.
  72.      * <p>
  73.      * Generally implemented with 
  74.      * <code>getRootPane().setContentPane(contentPane);</code>
  75.      * 
  76.      * @exception java.awt.IllegalComponentStateException (a runtime
  77.      *            exception) if the content pane parameter is null
  78.      * @param contentPane the Container to use for the contents of this
  79.      *        JRootPane
  80.      * @see JRootPane#getContentPane
  81.      * @see #getContentPane
  82.      */
  83.     void setContentPane(Container contentPane);
  84.  
  85.  
  86.     /**
  87.      * Returns the contentPane.
  88.      *
  89.      * @return the value of the contentPane property.
  90.      * @see #setContentPane
  91.      */
  92.     Container getContentPane();
  93.  
  94.  
  95.     /**
  96.      * A Container that manages the contentPane and in some cases a menu bar. 
  97.      * The layeredPane can be used by descendants that want to add a child
  98.      * to the RootPaneContainer that isn't layout managed.  For example
  99.      * an internal dialog or a drag and drop effect component.
  100.      * <p>
  101.      * The layeredPane may not be null.
  102.      * <p>
  103.      * Generally implemented with<pre> 
  104.      *    getRootPane().setLayeredPane(layeredPane);</pre>
  105.      * 
  106.      * @exception java.awt.IllegalComponentStateException (a runtime
  107.      *            exception) if the layered pane parameter is null
  108.      * @see #getLayeredPane
  109.      * @see JRootPane#getLayeredPane
  110.      */
  111.     void setLayeredPane(JLayeredPane layeredPane);
  112.  
  113.  
  114.     /**
  115.      * Returns the layeredPane.
  116.      *
  117.      * @return the value of the layeredPane property.
  118.      * @see #setLayeredPane
  119.      */
  120.     JLayeredPane getLayeredPane();
  121.  
  122.  
  123.     /**
  124.      * The glassPane is always the first child of the rootPane
  125.      * and the rootPanes layout manager ensures that it's always
  126.      * as big as the rootPane.  By default it's transparent and
  127.      * not visible.  It can be used to temporarily grab all keyboard 
  128.      * and mouse input by adding listeners and then making it visible.
  129.      * by default it's not visible.
  130.      * <p>
  131.      * The glassPane may not be null.
  132.      * <p>
  133.      * Generally implemented with 
  134.      * <code>getRootPane().setGlassPane(glassPane);</code>
  135.      * 
  136.      * @see #getGlassPane
  137.      * @see JRootPane#setGlassPane
  138.      */
  139.     void setGlassPane(Component glassPane);
  140.  
  141.  
  142.     /**
  143.      * Returns the glassPane.
  144.      *
  145.      * @return the value of the glassPane property.
  146.      * @see #setGlassPane
  147.      */
  148.     Component getGlassPane();
  149.  
  150. }
  151.  
  152.